# General Purpose Makefile for Linux Kernel module

KERNEL_VER := $(shell uname -r)

# set to path of corresponding kernel source tree
KERNEL_DIR ?= $(PATH_LINUX)

ifneq ($(KERNELRELEASE),)
	# call from kernel build system
	obj-m := test.o
else

default:
	$(MAKE) O=$(OUT) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KERNEL_DIR) M=$(CURDIR) modules

endif

clean:                                     
	$(MAKE) O=$(OUT) -C $(KERNEL_DIR) M=$(CURDIR) clean